<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
RandomKey (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="RandomKey (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/RandomKey.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/genetics/Population.html" title="interface in org.apache.commons.math3.genetics"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math3.genetics"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/genetics/RandomKey.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="RandomKey.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.genetics</FONT>
<BR>
Class RandomKey&lt;T&gt;</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">org.apache.commons.math3.genetics.Chromosome</A>
      <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">org.apache.commons.math3.genetics.AbstractListChromosome</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;
          <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.genetics.RandomKey&lt;T&gt;</B>
</PRE>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - type of the permuted objects</DL>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</A>&gt;, <A HREF="../../../../../org/apache/commons/math3/genetics/Fitness.html" title="interface in org.apache.commons.math3.genetics">Fitness</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</A>&lt;T&gt;</DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>RandomKey&lt;T&gt;</B><DT>extends <A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;<DT>implements <A HREF="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</A>&lt;T&gt;</DL>
</PRE>

<P>
Random Key chromosome is used for permutation representation. It is a vector
 of a fixed length of real numbers in [0,1] interval. The index of the i-th
 smallest value in the vector represents an i-th member of the permutation.
 <p>
 For example, the random key [0.2, 0.3, 0.8, 0.1] corresponds to the
 permutation of indices (3,0,1,2). If the original (unpermuted) sequence would
 be (a,b,c,d), this would mean the sequence (d,a,b,c).
 <p>
 With this representation, common operators like n-point crossover can be
 used, because any such chromosome represents a valid permutation.
 <p>
 Since the chromosome (and thus its arrayRepresentation) is immutable, the
 array representation is sorted only once in the constructor.
 <p>
 For details, see:
 <ul>
   <li>Bean, J.C.: Genetic algorithms and random keys for sequencing and
       optimization. ORSA Journal on Computing 6 (1994) 154-160</li>
   <li>Rothlauf, F.: Representations for Genetic and Evolutionary Algorithms.
       Volume 104 of Studies in Fuzziness and Soft Computing. Physica-Verlag,
       Heidelberg (2002)</li>
 </ul>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>2.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: RandomKey.java 1416643 2012-12-03 19:37:14Z tn $</DD>
</DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#RandomKey(java.lang.Double[])">RandomKey</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>[]&nbsp;representation)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#RandomKey(java.util.List)">RandomKey</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;&nbsp;representation)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#checkValidity(java.util.List)">checkValidity</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;&nbsp;chromosomeRepresentation)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asserts that <code>representation</code> can represent a valid chromosome.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;S&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#comparatorPermutation(java.util.List, java.util.Comparator)">comparatorPermutation</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;data,
                      <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;S&gt;&nbsp;comparator)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a representation of a permutation corresponding to the
 <code>data</code> sorted by <code>comparator</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#decode(java.util.List)">decode</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>&gt;&nbsp;sequence)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Permutes the <code>sequence</code> of objects of type T according to the
 permutation this chromosome represents.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#identityPermutation(int)">identityPermutation</A></B>(int&nbsp;l)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a representation corresponding to an identity permutation of
 length l which can be passed to the RandomKey constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;S&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#inducedPermutation(java.util.List, java.util.List)">inducedPermutation</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;originalData,
                   <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;permutedData)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a representation of a permutation corresponding to a
 permutation which yields <code>permutedData</code> when applied to
 <code>originalData</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#isSame(org.apache.commons.math3.genetics.Chromosome)">isSame</A></B>(<A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</A>&nbsp;another)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> iff <code>another</code> is a RandomKey and
 encodes the same permutation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#randomPermutation(int)">randomPermutation</A></B>(int&nbsp;l)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a representation corresponding to a random permutation of
 length l which can be passed to the RandomKey constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.genetics.AbstractListChromosome"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math3.genetics.<A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#getLength()">getLength</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#getRepresentation()">getRepresentation</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#newFixedLengthChromosome(java.util.List)">newFixedLengthChromosome</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.genetics.Chromosome"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math3.genetics.<A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html#compareTo(org.apache.commons.math3.genetics.Chromosome)">compareTo</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html#findSameChromosome(org.apache.commons.math3.genetics.Population)">findSameChromosome</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html#getFitness()">getFitness</A>, <A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html#searchForFitnessUpdate(org.apache.commons.math3.genetics.Population)">searchForFitnessUpdate</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.genetics.Fitness"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface org.apache.commons.math3.genetics.<A HREF="../../../../../org/apache/commons/math3/genetics/Fitness.html" title="interface in org.apache.commons.math3.genetics">Fitness</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/Fitness.html#fitness()">fitness</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="RandomKey(java.util.List)"><!-- --></A><H3>
RandomKey</H3>
<PRE>
public <B>RandomKey</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;&nbsp;representation)
          throws <A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></PRE>
<DL>
<DD>Constructor.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>representation</CODE> - list of [0,1] values representing the permutation
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></CODE> - iff the <code>representation</code> can not represent a valid chromosome</DL>
</DL>
<HR>

<A NAME="RandomKey(java.lang.Double[])"><!-- --></A><H3>
RandomKey</H3>
<PRE>
public <B>RandomKey</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>[]&nbsp;representation)
          throws <A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></PRE>
<DL>
<DD>Constructor.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>representation</CODE> - array of [0,1] values representing the permutation
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></CODE> - iff the <code>representation</code> can not represent a valid chromosome</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="decode(java.util.List)"><!-- --></A><H3>
decode</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>&gt; <B>decode</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>&gt;&nbsp;sequence)</PRE>
<DL>
<DD>Permutes the <code>sequence</code> of objects of type T according to the
 permutation this chromosome represents. For example, if this chromosome
 represents a permutation (3,0,1,2), and the unpermuted sequence is
 (a,b,c,d), this yields (d,a,b,c).
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html#decode(java.util.List)">decode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</A>&lt;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the unpermuted (original) sequence of objects
<DT><B>Returns:</B><DD>permutation of <code>sequence</code> represented by this permutation</DL>
</DD>
</DL>
<HR>

<A NAME="isSame(org.apache.commons.math3.genetics.Chromosome)"><!-- --></A><H3>
isSame</H3>
<PRE>
protected boolean <B>isSame</B>(<A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</A>&nbsp;another)</PRE>
<DL>
<DD>Returns <code>true</code> iff <code>another</code> is a RandomKey and
 encodes the same permutation.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html#isSame(org.apache.commons.math3.genetics.Chromosome)">isSame</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>another</CODE> - chromosome to compare
<DT><B>Returns:</B><DD>true iff chromosomes encode the same permutation</DL>
</DD>
</DL>
<HR>

<A NAME="checkValidity(java.util.List)"><!-- --></A><H3>
checkValidity</H3>
<PRE>
protected void <B>checkValidity</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;&nbsp;chromosomeRepresentation)
                      throws <A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></PRE>
<DL>
<DD>Asserts that <code>representation</code> can represent a valid chromosome.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#checkValidity(java.util.List)">checkValidity</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>chromosomeRepresentation</CODE> - representation of the chromosome
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</A></CODE> - iff the <code>representation</code> can not represent a valid chromosome</DL>
</DD>
</DL>
<HR>

<A NAME="randomPermutation(int)"><!-- --></A><H3>
randomPermutation</H3>
<PRE>
public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt; <B>randomPermutation</B>(int&nbsp;l)</PRE>
<DL>
<DD>Generates a representation corresponding to a random permutation of
 length l which can be passed to the RandomKey constructor.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>l</CODE> - length of the permutation
<DT><B>Returns:</B><DD>representation of a random permutation</DL>
</DD>
</DL>
<HR>

<A NAME="identityPermutation(int)"><!-- --></A><H3>
identityPermutation</H3>
<PRE>
public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt; <B>identityPermutation</B>(int&nbsp;l)</PRE>
<DL>
<DD>Generates a representation corresponding to an identity permutation of
 length l which can be passed to the RandomKey constructor.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>l</CODE> - length of the permutation
<DT><B>Returns:</B><DD>representation of an identity permutation</DL>
</DD>
</DL>
<HR>

<A NAME="comparatorPermutation(java.util.List, java.util.Comparator)"><!-- --></A><H3>
comparatorPermutation</H3>
<PRE>
public static &lt;S&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt; <B>comparatorPermutation</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;data,
                                                     <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;S&gt;&nbsp;comparator)</PRE>
<DL>
<DD>Generates a representation of a permutation corresponding to the
 <code>data</code> sorted by <code>comparator</code>. The
 <code>data</code> is not modified during the process.

 This is useful if you want to inject some permutations to the initial
 population.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>S</CODE> - type of the data<DT><B>Parameters:</B><DD><CODE>data</CODE> - list of data determining the order<DD><CODE>comparator</CODE> - how the data will be compared
<DT><B>Returns:</B><DD>list representation of the permutation corresponding to the parameters</DL>
</DD>
</DL>
<HR>

<A NAME="inducedPermutation(java.util.List, java.util.List)"><!-- --></A><H3>
inducedPermutation</H3>
<PRE>
public static &lt;S&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt; <B>inducedPermutation</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;originalData,
                                                  <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;S&gt;&nbsp;permutedData)
                                       throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A>,
                                              <A HREF="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></PRE>
<DL>
<DD>Generates a representation of a permutation corresponding to a
 permutation which yields <code>permutedData</code> when applied to
 <code>originalData</code>.

 This method can be viewed as an inverse to <A HREF="../../../../../org/apache/commons/math3/genetics/RandomKey.html#decode(java.util.List)"><CODE>decode(List)</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>S</CODE> - type of the data<DT><B>Parameters:</B><DD><CODE>originalData</CODE> - the original, unpermuted data<DD><CODE>permutedData</CODE> - the data, somehow permuted
<DT><B>Returns:</B><DD>representation of a permutation corresponding to the permutation
   <code>originalData -> permutedData</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - iff the length of <code>originalData</code>
   and <code>permutedData</code> lists are not equal
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></CODE> - iff the <code>permutedData</code> and
   <code>originalData</code> lists contain different data</DL>
</DD>
</DL>
<HR>

<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>&gt;</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/RandomKey.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/genetics/Population.html" title="interface in org.apache.commons.math3.genetics"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math3.genetics"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/genetics/RandomKey.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="RandomKey.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
